* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', sans-serif;
}

/* 基础响应式设置 */
html {
    font-size: 16px;
}

.watermark {
    position: fixed;
    top: 10px;
    left: 10px;
    font-size: 12px;
    color: rgba(128, 128, 128, 0.5);
    z-index: 1000;
}

body {
    background-color: #1a1a1a;
    padding: 20px;
    min-height: 100vh;
    position: relative;
}

.particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.container {
    max-width: 1400px;
    width: 95%;
    margin: 0 auto;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.task-form {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.05);
}

.task-form h2 {
    margin-bottom: 15px;
    color: #444;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

.quadrant-container {
    position: relative;
    width: 100%;
    max-width: 1360px;
    height: 800px;
    margin: 0 auto;
    background: #fff;
    display: flex;
    gap: 20px;
}

.task-list {
    width: 350px;
    height: 800px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    padding: 15px;
    flex-shrink: 0;
}

.task-list-item {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.task-list-item:hover {
    transform: translateX(5px);
}

.task-list-item .task-title {
    font-size: 16px;
    margin-bottom: 5px;
}

.task-list-item .task-deadline {
    font-size: 12px;
    color: #666;
}

.coordinate-system-container {
    flex: 1;
    position: relative;
    height: 100%;
}

/* 坐标轴样式 */
.coordinate-system {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* X轴 */
.x-axis {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #333;
}

/* Y轴 */
.y-axis {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background-color: #333;
}

/* 坐标轴箭头 */
.x-axis::after,
.y-axis::after {
    content: '';
    position: absolute;
    border: 6px solid transparent;
}

.x-axis::after {
    right: -6px;
    top: -5px;
    border-left-color: #333;
}

.y-axis::after {
    top: -6px;
    left: -5px;
    border-bottom-color: #333;
}

/* 象限背景色 */
.quadrant {
    position: absolute;
    width: 50%;
    height: 50%;
    opacity: 0.2;
}

#quadrant-1 {
    top: 0;
    right: 0;
    background-color: #e57373;
}

#quadrant-2 {
    top: 0;
    left: 0;
    background-color: #81c784;
}

#quadrant-3 {
    bottom: 0;
    right: 0;
    background-color: #ffd54f;
}

#quadrant-4 {
    bottom: 0;
    left: 0;
    background-color: #64b5f6;
}

/* 坐标轴标签 */
.axis-label {
    position: absolute;
    font-size: 14px;
    color: #333;
}

.x-label-right {
    right: 10px;
    top: 52%;
}

.x-label-left {
    left: 10px;
    top: 52%;
}

.y-label-top {
    top: 10px;
    left: 52%;
}

.y-label-bottom {
    bottom: 10px;
    left: 52%;
}

.tasks-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.task-item {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: move;
    transition: all 0.2s ease;
    z-index: 10;
}

/* 剩余时间少于2天的任务点样式 */
.task-item.less-than-day {
    width: 30px;
    /* 1.5倍大小 */
    height: 30px;
    background-color: rgb(255, 76, 63) !important;
    /* 1.5倍大小 */
    box-shadow: 0 0 15px 5px rgb(241, 79, 21) !important;
    z-index: 20;
}

/* 剩余时间少于10小时的任务点样式 */
.task-item.less-than-hours {
    width: 30px;
    /* 1.5倍大小 */
    height: 30px;
    /* 1.5倍大小 */
    animation: blink 0.4s infinite alternate;
    z-index: 30;
}

/* 闪烁动画 */
@keyframes blink {
    0% {
        opacity: 1;
        box-shadow: 0 0 20px 8px rgba(255, 0, 0, 0.9);
    }

    100% {
        opacity: 0.8;
        box-shadow: 0 0 10px 4px rgba(255, 0, 0, 0.5);
    }
}

.task-item::before {
    content: attr(data-title) '\A（' attr(data-leftInfo)'）';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 5px;
    padding: 4px 8px;
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 6px;
    font-size: 13px;
    white-space: pre;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 1;
}

.task-item.dragging {
    transform: scale(1.2);
    opacity: 0.8;
    z-index: 100;
}

.task-item:hover {
    transform: scale(1.3);
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.task-item.dragging {
    opacity: 0.7;
    transform: scale(1.2);
}

.task-item::after {
    content: attr(data-description) '\A截止时间：' attr(data-deadline) '\A' attr(data-leftInfo);
    display: block;
    white-space: pre-wrap;
    word-break: break-all;
    text-align: left;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    min-width: 200px;
    max-width: 400px;
    max-height: 300px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 2;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.task-item:hover::after {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.task-item::after:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 不同象限的任务点颜色 */
#quadrant-1 .task-item {
    background-color: #e57373;
    box-shadow: 0 0 5px #e57373;
}

#quadrant-2 .task-item {
    background-color: #81c784;
    box-shadow: 0 0 5px #81c784;
}

#quadrant-3 .task-item {
    background-color: #ffd54f;
    box-shadow: 0 0 5px #ffd54f;
}

#quadrant-4 .task-item {
    background-color: #64b5f6;
    box-shadow: 0 0 5px #64b5f6;
}

/* 历史任务区域样式 */
.history-container {
    margin-top: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.05);
}

.history-container h2 {
    margin-bottom: 15px;
    color: #444;
}

.history-tasks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.history-task-item {
    background-color: #e0e0e0;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: background-color 0.3s;
}

.history-task-item:hover {
    background-color: #d0d0d0;
}

/* 拖拽相关样式 */
.task-item.dragging {
    opacity: 0.5;
    transform: scale(1.2);
    z-index: 1000;
}

.quadrant.drag-over {
    background-color: rgba(255, 255, 255, 0.3);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5vh auto;
    padding: 20px;
    border-radius: 8px;
    width: 60%;
    max-width: 600px;
    max-height: 90vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow-y: auto;
}

.modal-content .deadline-info {
    font-size: 14px;
    color: #666;
    margin: 10px 0;
    font-style: italic;
    border-left: 3px solid #4CAF50;
    padding-left: 10px;
    background-color: #f5f5f5;
    padding: 8px 12px;
    border-radius: 4px;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

#modal-task-title {
    margin-bottom: 15px;
    color: #333;
}

#modal-task-description {
    line-height: 1.6;
    color: #555;
    margin-bottom: 20px;
    max-height: calc(70vh - 100px);
    overflow-y: auto;
    padding-right: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
}

#modal-task-description::-webkit-scrollbar {
    width: 6px;
}

#modal-task-description::-webkit-scrollbar-track {
    background: transparent;
}

#modal-task-description::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

#modal-task-description::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.complete-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.complete-btn:hover {
    background-color: #45a049;
}

.edit-btn {
    background-color: #2196F3;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.edit-btn:hover {
    background-color: #0b7dda;
}

.close-edit {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close-edit:hover {
    color: #333;
}

.restore-btn {
    background-color: #2196F3;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    margin-left: 10px;
}

.restore-btn:hover {
    background-color: #1976D2;
}

/* 确认对话框样式 */
.confirm-content {
    width: 400px;
    text-align: center;
    margin: 20vh auto;
    /* 调整垂直位置到页面中央 */
}

.confirm-content h3 {
    margin-bottom: 15px;
    color: #333;
}

.confirm-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.confirm-btn {
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

#confirm-yes {
    background-color: #f44336;
    color: white;
}

#confirm-yes:hover {
    background-color: #d32f2f;
}

#confirm-no {
    background-color: #9e9e9e;
    color: white;
}

#confirm-no:hover {
    background-color: #757575;
}

/* 响应式设计 - 媒体查询 */
@media screen and (max-width: 1400px) {
    .quadrant-container {
        height: 700px;
    }

    .task-list {
        width: 300px;
        height: 700px;
    }
}

@media screen and (max-width: 1200px) {
    .quadrant-container {
        height: 600px;
    }

    .task-list {
        width: 250px;
        height: 600px;
    }

    .task-form,
    .history-container {
        padding: 15px;
    }
}

@media screen and (max-width: 992px) {
    html {
        font-size: 14px;
    }

    .container {
        padding: 15px;
    }

    .quadrant-container {
        flex-direction: column;
        height: auto;
        gap: 15px;
    }

    /* 调整顺序：坐标系在上，任务列表在下 */
    .coordinate-system-container {
        height: 500px;
        order: 1;
        /* 设置顺序为1，显示在前面 */
        margin-bottom: 15px;
        margin-top: 0;
        width: 100%;
    }

    .task-list {
        width: 100%;
        height: 60vh;
        order: 2;
        /* 设置顺序为2，显示在后面 */
    }

    .modal-content {
        width: 80%;
    }

    /* 确保坐标轴标签在小屏幕上正确显示 */
    .axis-label {
        font-size: 14px;
        font-weight: bold;
    }

    /* 增加坐标轴的可见性 */
    .x-axis,
    .y-axis {
        background-color: #000;
    }

    .x-axis {
        height: 3px;
    }

    .y-axis {
        width: 3px;
    }
}

@media screen and (max-width: 768px) {
    html {
        font-size: 13px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .container {
        padding: 10px;
    }

    .coordinate-system-container {
        height: 450px;
        order: 1;
        /* 保持坐标系在上方 */
        margin-bottom: 15px;
        margin-top: 0;
        width: 100%;
    }

    .task-list {
        height: 60vh;
        order: 2;
        /* 保持任务列表在下方 */
        width: 100%;
    }

    /* 增强坐标轴的可见性 */
    .x-axis,
    .y-axis {
        background-color: #000;
    }

    .x-axis {
        height: 3px;
    }

    .y-axis {
        width: 3px;
    }

    /* 增强坐标轴标签的可见性 */
    .axis-label {
        font-size: 15px;
        font-weight: bold;
    }

    .x-label-right {
        right: 8px;
    }

    .x-label-left {
        left: 8px;
    }

    .y-label-top {
        top: 8px;
    }

    .y-label-bottom {
        bottom: 8px;
    }

    .task-form,
    .history-container {
        padding: 10px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 8px;
        font-size: 14px;
    }

    button {
        padding: 8px 16px;
        font-size: 14px;
    }

    .modal-content {
        width: 90%;
        padding: 15px;
    }
}

@media screen and (max-width: 576px) {
    html {
        font-size: 12px;
    }

    .container {
        width: 98%;
        padding: 8px;
    }

    .coordinate-system-container {
        height: 400px;
        order: 1;
        /* 保持坐标系在上方 */
        margin-bottom: 15px;
        margin-top: 0;
        width: 100%;
    }

    .task-list {
        height: 60vh;
        order: 2;
        /* 保持任务列表在下方 */
        width: 100%;
    }

    /* 增强坐标轴的可见性 */
    .x-axis,
    .y-axis {
        background-color: #000;
    }

    .x-axis {
        height: 4px;
    }

    .y-axis {
        width: 4px;
    }

    /* 增强坐标轴标签的可见性 */
    .axis-label {
        font-size: 16px;
        font-weight: bold;
        color: #000;
        background-color: rgba(255, 255, 255, 0.7);
        padding: 2px 5px;
        border-radius: 3px;
    }

    .x-label-right {
        right: 5px;
    }

    .x-label-left {
        left: 5px;
    }

    .y-label-top {
        top: 5px;
    }

    .y-label-bottom {
        bottom: 5px;
    }

    .task-list-item {
        padding: 8px;
    }

    .task-list-item .task-title {
        font-size: 14px;
    }

    .task-list-item .task-deadline {
        font-size: 11px;
    }

    .watermark {
        font-size: 10px;
    }

    .task-item::before {
        font-size: 11px;
    }

    .task-item::after {
        font-size: 12px;
        min-width: 150px;
        max-width: 250px;
    }

    .modal-content {
        width: 95%;
        margin: 3vh auto;
        padding: 12px;
    }

    .confirm-content {
        width: 90%;
    }

    /* 增强任务点的可见性 */
    .task-item {
        width: 22px;
        height: 22px;
    }

    .task-item.less-than-day,
    .task-item.less-than-hours {
        width: 32px;
        height: 32px;
    }
}

@media screen and (max-width: 992px) {
    .coordinate-system-container {
        height: 500px;
        min-height: 400px;
        position: relative;
        overflow: visible;
    }

    .coordinate-system {
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
    }

    .tasks-container {
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
    }

    .task-item {
        position: absolute;
        transform: translate(-50%, -50%);
    }

    .x-axis,
    .y-axis {
        background-color: #000 !important;
        z-index: 5;
    }
}

.footer-links {
    margin-top: 30px;
    text-align: center;
    padding: 15px 0;
    border-top: 1px solid #eee;
}

.footer-link {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 10px;
    color: #4CAF50;
    text-decoration: none;
    border: 1px solid #4CAF50;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.footer-link:hover {
    background-color: #4CAF50;
    color: white;
}

/* 使用说明页面样式 */
.instruction-content {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.instruction-content section {
    margin-bottom: 30px;
}

.instruction-content h2 {
    color: #444;
    margin-bottom: 15px;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 8px;
}

.instruction-content p {
    line-height: 1.6;
    color: #555;
    margin-bottom: 15px;
}

.instruction-content ul,
.instruction-content ol {
    padding-left: 20px;
    margin-bottom: 15px;
}

.instruction-content li {
    margin-bottom: 10px;
    line-height: 1.6;
    color: #555;
}

.instruction-content strong {
    color: #333;
}

@media screen and (max-width: 768px) {
    .instruction-content {
        padding: 15px;
    }

    .instruction-content h2 {
        font-size: 1.4rem;
    }

    .instruction-content ul,
    .instruction-content ol {
        padding-left: 15px;
    }
}

@media screen and (max-width: 576px) {
    .coordinate-system-container {
        height: 70vh;
        /* 改为视窗高度百分比 */
        min-height: 300px;
    }

    .x-axis {
        height: 4px;
    }

    .y-axis {
        width: 4px;
    }
}